package com.myapp.ui;

import android.app.Activity;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.view.ViewPager.LayoutParams;
import android.util.DisplayMetrics;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.myapp.R;
import com.myapp.util.ScreenManager;

public class SalesDetailActivity extends Activity {
	
	private DisplayMetrics metrics;
	private LinearLayout sales_top_ly;
	private TextView sales_detail_title,sales_detail_effectiveTime,sales_detail_content;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_sales_detail);
		Intent i = getIntent();
		Bundle b = i.getExtras();
		metrics = new DisplayMetrics();
		getWindowManager().getDefaultDisplay().getMetrics(metrics);
		sales_top_ly = (LinearLayout)findViewById(R.id.sales_detail_top_ly);
		sales_detail_title = (TextView)findViewById(R.id.sales_detail_title);
		sales_detail_effectiveTime = (TextView)findViewById(R.id.sales_detail_effectiveTime);
		sales_detail_content = (TextView)findViewById(R.id.sales_detail_content);
		
		sales_detail_title.setText(b.getString("title"));
		sales_detail_effectiveTime.setText("2012.10.28"+"~"+"2012.11.28");
		sales_detail_content.setText(b.getString("content"));
		setWAndH();
	}
	
	private void setWAndH(){
		ScreenManager.setMyLayoutParam(sales_top_ly, LayoutParams.FILL_PARENT, ScreenManager.getHeight(0.08f, metrics));
	}
	
}
